package com.zjp.mg.dao;

import com.mongodb.client.result.UpdateResult;
import com.zjp.mg.core.GridModel;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.UpdateDefinition;

import java.util.Collection;
import java.util.List;

public interface MgDao<T> {

    GridModel<T> queryPage(Integer page, Integer size, Class<T> entityClass, Query query);

    T insert(T object);

    void save(T object);

    void insert(Collection<? extends Object> batchToSave);

    long remove(Query query);

    long removeByObject(T object);

    List<T> find(Query query);

    T findOne(Query query);

    T findById(Object id);

    List<T> findAll();

    long count(Query query);

    UpdateResult update(Query query, UpdateDefinition updateDefinition);



}
